#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>

#ifdef NOSYSCALL
static int myfunc() { return 1; }
#endif

int main(int argc, char *argv[]) {
  int numCalls, j;

  numCalls = 10000000;
  if (argc > 1) {
    numCalls = strtol(argv[1], NULL, 10);
  }

#ifdef NOSYSCALL
  printf("Calling normal function\n");
#else
  printf("Calling getppid()\n");
#endif

  for (j = 0; j < numCalls; j++)
#ifdef NOSYSCALL
    myfunc();
#else
    getppid();
#endif

  exit(EXIT_SUCCESS);
}
